<?php
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
// DLMan by Shedd Technologies International		  				//
// http://www.dlman.com | info@dlman.com							//
// Copyright 2003 by STI, All rights reserved.						//
// ---------------------------------------------------------------- //
// Usage of this software is governed by the terms of GPL. 	    	//
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//

/*
View transaction details.
*/
require_once("global.php");

$datesplit=explode("_",$trans_id);
$lowerArray=getdate($datesplit[0]);
$upperArray=getdate($datesplit[1]);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<title>Transaction Detail</title>
</head>
<body>
<P align=center><FONT face=Verdana><STRONG>Transactions from 
<?php
print $lowerArray["month"];
print " ";
print $lowerArray["mday"];
print ", ";
print $lowerArray["year"];
?>
</STRONG></FONT></P>
<table cellspacing="0" cellpadding="2" border="0">
<?php
$sql="SELECT * FROM ".$config->dt['transactions'].", ".$config->dt['files']." WHERE ".$config->dt['transactions'].".file_id = ".$config->dt['files'].".id AND timestamp>'$datesplit[0]' AND timestamp<'$datesplit[1]' AND ".$config->dt['transactions'].".status='ACTIVE' ORDER BY timestamp";
$result=@mysql_query($sql);
$num=@mysql_num_rows($result);
$i=1;
if($num>0){
	while($value=@mysql_fetch_array($result)){
		//get username
		$s="SELECT ".$config->field['username']." FROM ".$config->dt['user']." WHERE ".$config->field['userid']."='$value[uid]'";
		$r=mysql_query($s);
		$v=mysql_fetch_array($r);
		//get exact time
		$edate=date("H:i:s",$value['timestamp']);
		?>
			<tr>
			    <td valign="top"><FONT face=Verdana><STRONG><?php print $i; ?>)</STRONG></FONT></td>
			    <td><FONT face=Verdana><?php print $value['name']; ?> ($<?php print sprintf("%.2f",$value['cost']); ?>)<br><?php print $v[$config->field['username']]; ?><br><?php print $edate; ?></FONT></td>
			</tr>
		<?php
		$i++;
	}//end while
}//end more than 0
?>
</table>
</body>
</html>
